<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://shiro.apache.org/tags" prefix="s"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>${webName}-后台管理系统</title>
<link rel="stylesheet" href="${res}/layui/css/layui.css">
<link rel="stylesheet" href="${res}/story/css/admin.css">
</head>
<body>
<div id="addAdminForm" style="margin:15px 25px 0px 5px ;">
	<form id="addAdminPage" class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label">管理员账号</label>
			<div class="layui-input-inline">
				<input id="addAdminUsername" type="text" name="username" lay-verify="title"
					autocomplete="off" placeholder="请输入管理员账号" class="layui-input" onblur="verifyUsername(this.value)">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">管理员密码</label>
			<div class="layui-input-inline">
				<input type="password" name="password" lay-verify="required"
					placeholder="请输入管理员密码" autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">确认密码</label>
				<div class="layui-input-inline">
					<input type="password" name="repassword" placeholder="请确认输入管理员密码"
						autocomplete="off" class="layui-input">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">添加角色</label>
				<div class="layui-input-inline">
					<select name="role" lay-verify="">
					  <option value="">请选择一个角色...</option>
					  <option value="010">北京</option>
					  <option value="021">上海</option>
					  <option value="0571">杭州</option>
					</select>    
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">账号状态</label>
				<div class="layui-input-inline">
					<input type="checkbox" name="accountActive" lay-skin="switch" lay-text="锁定|正常">
				</div>
			</div>
			
			 <div class="layui-inline">
			    <label class="layui-form-label">管理员等级</label>
			    <div class="layui-input-inline">
			      <input type="text" name="level" autocomplete="off"  placeholder="请输入比0大的整数" class="layui-input">
			    </div>
 			 </div>
		</div>
	</form>
</div>
<script src="${res}/layui/layui.js"></script>
<script type="text/javascript">
	var $;
	layui.use(['element','layer','form'],function(){
		var _this = this;
		var element = layui.element;
		$ = layui.$;
		var layer = layui.layer;
		var form = layui.form;
		
	});
	function verifyUsername(value){
		 if(!/^[A-Za-z][A-Za-z1-9_-]{5,14}$/.test(value)){
			 layer.open({
				 type:4,
				 content: ['用户名必须是以字母开头的15位字母和数字！', '#addAdminUsername'],
				 tips: [3, '#FF0000'],
				 shade: 0,
				 time:3000,
				 closeBtn: 0
			 });
			 console.info($('input[name=username]').val());
			 $('input[name=username]').addClass('story-input-warning');
		     return false;
		 }else{
			 $('input[name=username]').removeClass('story-input-warning');
		     return true;
		 }
	}
</script>
</body>
</html>